import React, {Component} from 'react';
import {
    routes,
    Router,
    RouterView,
    Switch,
    Redirect
} from '@/router'


class App extends Component {
    constructor(props) {
        super(props);
        this.state = {};
        //console.log(props);
    }

    render() {
        return (
            <>
                {/* 主路由 页面 */}
                <Router>
                    <Switch>
                        {routes.map((route, i) => (
                            <RouterView key={i} {...route}/>
                        ))}
                        <Redirect to={'/home'}/>

                    </Switch>
                </Router>
            </>
        );
    }
}

export default App;
